Optimal. Leaf size=51 \[ \frac{a \cos (c+d x)}{d}-\frac{a \tanh ^{-1}(\cos (c+d x))}{d}+\frac{b \sin (c+d x) \cos (c+d x)}{2 d}+\frac{b x}{2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0694966, antiderivative size = 51, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.261, Rules used = {2838, 2592, 321, 206, 2635, 8} \[ \frac{a \cos (c+d x)}{d}-\frac{a \tanh ^{-1}(\cos (c+d x))}{d}+\frac{b \sin (c+d x) \cos (c+d x)}{2 d}+\frac{b x}{2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2838
Rule 2592
Rule 321
Rule 206
Rule 2635
Rule 8
Rubi steps
\begin{align*} \int \cos (c+d x) \cot (c+d x) (a+b \sin (c+d x)) \, dx &=a \int \cos (c+d x) \cot (c+d x) \, dx+b \int \cos ^2(c+d x) \, dx\\ &=\frac{b \cos (c+d x) \sin (c+d x)}{2 d}+\frac{1}{2} b \int 1 \, dx-\frac{a \operatorname{Subst}\left (\int \frac{x^2}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac{b x}{2}+\frac{a \cos (c+d x)}{d}+\frac{b \cos (c+d x) \sin (c+d x)}{2 d}-\frac{a \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac{b x}{2}-\frac{a \tanh ^{-1}(\cos (c+d x))}{d}+\frac{a \cos (c+d x)}{d}+\frac{b \cos (c+d x) \sin (c+d x)}{2 d}\\ \end{align*}
Mathematica [A] time = 0.0541021, size = 74, normalized size = 1.45 \[ \frac{a \cos (c+d x)}{d}+\frac{a \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )}{d}-\frac{a \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )}{d}+\frac{b (c+d x)}{2 d}+\frac{b \sin (2 (c+d x))}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.048, size = 63, normalized size = 1.2 \begin{align*}{\frac{\cos \left ( dx+c \right ) a}{d}}+{\frac{a\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{d}}+{\frac{b\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2\,d}}+{\frac{bx}{2}}+{\frac{cb}{2\,d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.03717, size = 77, normalized size = 1.51 \begin{align*} \frac{{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} b + 2 \, a{\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.47206, size = 174, normalized size = 3.41 \begin{align*} \frac{b d x + b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 2 \, a \cos \left (d x + c\right ) - a \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) + a \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sin{\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )} \csc{\left (c + d x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.32054, size = 117, normalized size = 2.29 \begin{align*} \frac{{\left (d x + c\right )} b + 2 \, a \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) - \frac{2 \,{\left (b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 2 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 2 \, a\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]